<?php

class BlockAdmin
{
    private $paths;
    private $body;
    private $name;
    private $nameId;
    private $_db;
    
    public function __construct($name, $nameId, $body, $paths)
    {
        $this->name = $name;
        $this->nameId = $nameId;
        $this->body = $body;
        $this->paths = $paths;
        $this->_db = Db::getInstance();
    }
    
    public function addBlock()
    {
        $this->_db->q("insert into `blocks` (name, nameId, body, paths) values ('".$this->name."', '".$this->nameId."', '".$this->body."', '".serialize($this->paths)."')");
    }
}
?>
